# import necessary packages
import argparse
import cv2 as cv

# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="The Path to Image")
args = vars(ap.parse_args())

# load the image,display it ,and initialize the list of kernel sizes
image = cv.imread(args["image"])
cv.imshow("Original", image)
kernelSizes = [(3, 3), (9, 9), (15, 15)]

# loop over the kernel sizes and apply an `average` blur to the image
for (kX,kY) in kernelSizes:
    blurred = cv.blur(image,(kX,kY))
    cv.imshow("Average ({},{})".format(kX,kY),blurred)
    cv.waitKey(0)

# close all windows to cleanup the screen
cv.destroyAllWindows()
cv.imshow("Original",image)

# loop over the kernel sizes and apply a "Gaussian" blur to the image
for (kX,kY) in kernelSizes:
    blurred =cv.GaussianBlur(image,(kX,kY),0)
    cv.imshow("Gaussian ({},{})".format(kX,kY),blurred)
    cv.waitKey(0)

# close all windows to cleanup the screen
cv.destroyAllWindows()
cv.imshow("Original",image)

# loop over the kernel sizes and apply a "Median" blur to the image
for k in (3,9,15):
    blurred = cv.medianBlur(image,k)
    cv.imshow("Median {}".format(k),blurred)
    cv.waitKey(0)